import request from '@/utils/request.js'

// 常量
const api_name = '/admin/ad'

export default {
    getAdPage(params) {
        return request({
            url: `${api_name}/getAdPage`,
            method: 'get',
            params: params
        })
    },
    getAdDetailsById(id) {
        return request({
            url: `${api_name}/getAdDetailsById/${id}`,
            method: 'get'
        })
    },
    saveAd(data) {
        return request({
            url: `${api_name}/saveAd`,
            method: 'post',
            data: data
        })
    },
    updateAd(data) {
        return request({
            url: `${api_name}/updateAd`,
            method: 'post',
            data: data
        })
    },
    batchDeleteByIds(ids) {
        return request({
            url: `${api_name}/batchDeleteByIds`,
            method: 'post',
            data: ids
        })
    }
}
